# Contributor: omni <omni+alpine@hack.org>
# Maintainer: Edd Salkield <edd@salkield.uk>
pkgname=wormhole-william
pkgver=1.0.7
pkgrel=2
pkgdesc="Go implementation of Magic Wormhole"
arch="all"
url="https://github.com/psanford/wormhole-william"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/psanford/wormhole-william/archive/v$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v .
}

check() {
	go test -v ./...
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	ln -s /usr/bin/wormhole-william "$pkgdir"/usr/bin/wormhole
}

sha512sums="
1b0b152b7739207ea021bc7999fce7e59b5155b5019004d82aef22951f3678fbac9302a6f5af846793ed7b23670d17a142be0764424495f41a0c3d4bf14931ad  wormhole-william-1.0.7.tar.gz
"
